<template>
    <div>
      测试
      <el-select v-model="val" placeholder="请选择">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value">
        </el-option>
      </el-select>
    </div>
</template>

<script>
    export default {
      name: "T",
      props:["value"],
      components:{

      },
      created() {

      },
      mounted() {

      },
      computed: {
        val: {
          get() {
            console.log("子",this.value)
            return this.value
          },
          set(val) {
            this.$emit('update:value', val)
          }
        },
      },
      data(){
        return{
          options: [
             {value: 1, label: '黄金糕'},
             {value: 2, label: '双皮奶'},
             {value: 3, label: '蚵仔煎'},
             {value: 4, label: '龙须面'}
            ],
        }
      },
      methods:{

      },
      watch:{

      },
      beforeDestroy() {

      }

    }
</script>

<style scoped lang="scss">

</style>
